If we don't have a name on the way in, give it a shortname.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 19 Jan 2005 03:19:56 +0000 (03:19 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 19 Jan 2005 03:19:56 +0000 (03:19 +0000)
gpsbabel/route.c

index 0f07330877182e90ba8e7722e1a1df9e1668917f..4f3b8242801460673a06adb12c5653ab8238cd21 100644 (file)
@@ -100,6 +100,11 @@ route_add_wpt(route_head *rte, waypoint *wpt)
        ENQUEUE_TAIL(&rte->waypoint_list, &wpt->Q);
        rte->rte_waypt_ct++;    /* waypoints in this route */
        rte_waypts++;           /* total waypoints in all routes */
+       if (wpt->shortname == NULL) {
+               char tmpnam[10];
+               snprintf(tmpnam, sizeof(tmpnam), "RPT%03d",rte_waypts);
+               wpt->shortname = xstrdup(tmpnam);
+       }
 }
 
 void